import request from '@/utils/request'

// 查询抢购任务列表
export function listAhstask(query) {
  return request({
    url: '/system/ahstask/list',
    method: 'get',
    params: query
  })
}

// 查询抢购任务详细
export function getAhstask(id) {
  return request({
    url: '/system/ahstask/' + id,
    method: 'get'
  })
}

// 新增抢购任务
export function addAhstask(data) {
  return request({
    url: '/system/ahstask',
    method: 'post',
    data: data
  })
}

// 修改抢购任务
export function updateAhstask(data) {
  return request({
    url: '/system/ahstask',
    method: 'put',
    data: data
  })
}

// 删除抢购任务
export function delAhstask(id) {
  return request({
    url: '/system/ahstask/' + id,
    method: 'delete'
  })
}

// 爱回收分类品牌列表
export function getCategoryBrand(gaeaCategoryId) {
  return request({
    url: '/system/ahstask/getCategoryBrand',
    method: 'get',
    params: {
      gaeaCategoryId: gaeaCategoryId
    }
  })
}

// 爱回收产品型号列表
export function getProduct(gaeaCategoryId, gaeaBrandId) {
  return request({
    url: '/system/ahstask/getProduct',
    method: 'get',
    params: {
      gaeaCategoryId: gaeaCategoryId,
      gaeaBrandId: gaeaBrandId
    }
  })
}

// 爱回收产品型号参数
export function getPpvAssociation(gaeaCategoryId, gaeaBrandId, gaeaProductId) {
  return request({
    url: '/system/ahstask/getPpvAssociation',
    method: 'get',
    params: {
      gaeaCategoryId: gaeaCategoryId,
      gaeaBrandId: gaeaBrandId,
      gaeaProductId: gaeaProductId
    }
  })
}
